<script setup lang="ts">
import { computed, withDefaults } from 'vue'

type Props = {
  modelValue: string
  options: string[]
}

const props = defineProps<Props>()

const emit = defineEmits<{
  (e: 'update:modelValue', u: string): void
}>()
const value = computed({
  get() {
    return props.modelValue
  },
  set(value) {
    emit('update:modelValue', value)
  }
})
</script>
<template>
  <div class="select">
    <select v-model="value">
      <option v-for="opt in options" :value="opt">{{ opt }}</option>
    </select>
  </div>
</template>
